color picker: Better debug spew
authorMatthias Clasen <mclasen@redhat.com>
Mon, 30 Jul 2018 21:59:16 +0000 (17:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 Jul 2018 22:10:27 +0000 (18:10 -0400)
This will help in debugging issues.

gtk/gtkcolorpicker.c

index b3ac5dce78fecede4cd5ec59578eecaa8bb29630..d57ffe016e9940d4782d9fee68602c0177f3a69b 100644 (file)
@@ -51,9 +51,18 @@ gtk_color_picker_pick_finish (GtkColorPicker  *picker,
 GtkColorPicker *
 gtk_color_picker_new (void)
 {
+  GtkColorPicker *picker;
+
   if (gtk_should_use_portal ())
-    return gtk_color_picker_portal_new ();
+    picker = gtk_color_picker_portal_new ();
+  else
+    picker = gtk_color_picker_shell_new ();
+
+  if (picker)
+    g_debug ("Using %s for picking colors", g_type_name_from_instance (picker));
   else
-    return gtk_color_picker_shell_new ();
+    g_debug ("No suitable GtkColorPicker implementation\n");
+
+  return picker;
 }